$pageLang = $title->getPageLanguage()->getCode();
if ( $config->get( 'PageLanguageUseDB' )
- && $this->getTitle()->userCan( 'pagelang', $this->getUser() )
+ && $title->userCan( 'pagelang', $user )
) {
// Link to Special:PageLanguage with pre-filled page title if user has permissions
$titleObj = SpecialPage::getTitleFor( 'PageLanguage', $title->getPrefixedText() );
// Content model of the page
$modelHtml = htmlspecialchars( ContentHandler::getLocalizedName( $title->getContentModel() ) );
// If the user can change it, add a link to Special:ChangeContentModel
- if ( $title->quickUserCan( 'editcontentmodel' ) ) {
+ if ( $config->get( 'ContentHandlerUseDB' )
+ && $title->userCan( 'editcontentmodel', $user )
+ ) {
$modelHtml .= ' ' . $this->msg( 'parentheses' )->rawParams( $linkRenderer->makeLink(
SpecialPage::getTitleValueFor( 'ChangeContentModel', $title->getPrefixedText() ),
$this->msg( 'pageinfo-content-model-change' )->text()
$modelHtml
];
+ if ( $title->inNamespace( NS_USER ) ) {
+ $pageUser = User::newFromName( $title->getRootText() );
+ if ( $pageUser && $pageUser->getId() && !$pageUser->isHidden() ) {
+ $pageInfo['header-basic'][] = [
+ $this->msg( 'pageinfo-user-id' ),
+ $pageUser->getId()
+ ];
+ }
+ }
+
// Search engine status
$pOutput = new ParserOutput();
if ( isset( $pageProperties['noindex'] ) ) {
}
$expiry = $title->getRestrictionExpiry( $restrictionType );
$formattedexpiry = $this->msg( 'parentheses',
- $this->getLanguage()->formatExpiry( $expiry ) )->escaped();
+ $lang->formatExpiry( $expiry ) )->escaped();
$message .= $this->msg( 'word-separator' )->escaped() . $formattedexpiry;
// Messages: restriction-edit, restriction-move, restriction-create,
$more = null;
}
+ $templateListFormatter = new TemplatesOnThisPageFormatter(
+ $this->getContext(),
+ $linkRenderer
+ );
+
$pageInfo['header-properties'][] = [
$this->msg( 'pageinfo-templates' )
->numParams( $pageCounts['transclusion']['from'] ),
- Linker::formatTemplates(
- $transcludedTemplates,
- false,
- false,
- $more )
+ $templateListFormatter->format( $transcludedTemplates, false, $more )
];
}
$more = null;
}
+ $templateListFormatter = new TemplatesOnThisPageFormatter(
+ $this->getContext(),
+ $linkRenderer
+ );
+
$pageInfo['header-properties'][] = [
$this->msg( 'pageinfo-transclusions' )
->numParams( $pageCounts['transclusion']['to'] ),
- Linker::formatTemplates(
- $transcludedTargets,
- false,
- false,
- $more )
+ $templateListFormatter->format( $transcludedTargets, false, $more )
];
}
}
$dbr = wfGetDB( DB_REPLICA );
$dbrWatchlist = wfGetDB( DB_REPLICA, 'watchlist' );
-
$setOpts += Database::getCacheSetOptions( $dbr, $dbrWatchlist );
$watchedItemStore = MediaWikiServices::getInstance()->getWatchedItemStore();